<template>
  <div class="">
    <view class="footer-wrap">
      <view class="content flex">
        <view class="uni_cont flex1" v-for="(item, idx) in items" :key="idx">
          <view class="flex uni_item" @click="jumpTo(item.path)">
            <view class="uni_txt">
              <view class="uni_tit">{{ item.name }}</view>
              <view class="uni_etit">{{ item.eName }}</view>
            </view>
            <image class="uni_icon" src="../../static/img/navnext.png"></image>
          </view>
        </view>
      </view>
    </view>
    <!-- 选择酒 -->
    <choose-wine @chooseIsShow="chooseIsShow" v-if="isChooseShow"></choose-wine>
    <reg-member @menberShow="menberShow" v-if="isMenberShow"></reg-member>
  </div>
</template>

<script>
import chooseWine from '@/components/chooseWine.vue';
import regMember from '@/components/regMember.vue';
export default {
  components: {
    chooseWine,
    regMember
  },
  data() {
    return {
      items: [
        { name: '商城', eName: 'I want to drink', path: '/pages/goods/index' },
        { name: '帮您选酒', eName: 'I want to drink', path: 'chooseWine' },
        { name: '积分商城', eName: 'I want to drink', path: '/pages/goods/integral' },
        { name: '会员注册', eName: 'I want to drink', path: 'regMember' }
      ],
      isChooseShow: false,
      isMenberShow: false
    };
  },
  methods: {
    jumpTo(path) {
      if (path === 'chooseWine') {
        // 帮我点酒
        this.isMenberShow = false;
        this.isChooseShow = true;
      } else if (path === 'regMember') {
        this.isChooseShow = false;
        this.isMenberShow = true;
      } else {
        this.$common.navigateTo(path);
      }
    },
    chooseIsShow(data) {
      this.isChooseShow = false;
    },
    menberShow(data) {
      this.isMenberShow = false;
    }
  }
};
</script>

<style lang="scss" scoped>
.footer-wrap {
  position: fixed;
  background: #393939;
  height: 100px;
  bottom: 0;
  left: 0;
  right: 0;
  box-sizing: border-box;
  width: 100%;
  padding: 0 60px;
  .contant {
    width: 81.6%;
    margin: 0 auto;
  }
}
.uni_cont {
  margin-top: 23px;
  &:nth-child(2n) {
    .uni_item {
      background-color: #fff;
    }
  }
  .uni_item {
    width: 18vw;
    height: 5vw;
    border-radius: 2.5vw;
    margin: 0 auto;
    line-height: 5vw;
    align-items: center;
    justify-content: center;
    background: #c9ab6f;
  }
  .uni_txt {
    color: #000000;
  }
  .uni_tit {
    font-size: 2vw;
    line-height: 2vw;
    text-align: center;
  }
  .uni_etit {
    margin-top: 2px;
    font-size: 1vw;
    line-height: 1vw;
    text-align: center;
  }
  .uni_icon {
    margin-left: 5px;
    width: 18px;
    height: 18px;
  }
}
</style>
